package com.kob.backend.controller.favorite;

import com.baomidou.mybatisplus.annotation.TableId;
import com.kob.backend.service.favorite.FavoriteAddService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class FavoriteAddController {
    @Autowired
    private FavoriteAddService favoriteAddService;
    @PostMapping("/favorite/post/")
    public Map<String,String> addfavorite(@RequestParam Map<String,String>map){
        Integer userid = Integer.parseInt(map.get("userid"));
        Integer productid = Integer.parseInt(map.get("productid"));
        return favoriteAddService.addfavorite(userid,productid);
    }
}
